package com.example.demo.controller;
/*
 * 李洲 2020030654A1213
 * 2024.05.24
 */
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

@Controller
public class ModelController {

    @GetMapping("/greeting")
    public String greeting(Model model) {
        // 将数据存储在 Model 中
        model.addAttribute("message", "你好, 世界!");
        model.addAttribute("title", "欢迎页");
        return "greeting"; // 返回视图的名称
    }
}
